//
//  FZ_BoFang_One_TableCell.m
//  ProjectOfBStage
//
//  Created by dllo on 15/11/14.
//  Copyright © 2015年 cuixin. All rights reserved.
//

#import "FZ_BoFang_One_TableCell_One.h"
#import <UIImageView+WebCache.h>
#import "BaseHeader.h"
@interface FZ_BoFang_One_TableCell_One ()
@property (nonatomic ,retain) UILabel *labelOne;
@property (nonatomic ,retain) UIImageView *imageViewBig;
@property (nonatomic ,retain) UIImageView *imageViewSmall;
@property (nonatomic ,retain) UILabel *labelGuanZhu;
@property (nonatomic ,retain) UILabel *labelGuanZhuShu;
@end
@implementation FZ_BoFang_One_TableCell_One
- (void)dealloc
{
    [_labelOne release];
    [_imageViewBig release];
    [_imageViewSmall release];
    [_labelGuanZhu release];
    [_labelGuanZhuShu release];
    [super dealloc];
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self createSubviews];
        
    }
    return self;
}
- (void)createSubviews{
    self.labelOne = [[UILabel alloc] init];
//    self.labelOne.backgroundColor = [UIColor orangeColor];
    [self.labelOne setFont:[UIFont systemFontOfSize:15]];
    [self.contentView addSubview:self.labelOne];
    [_labelOne release];
    self.imageViewBig = [[UIImageView alloc] init];
//    self.imageViewBig.backgroundColor = [UIColor yellowColor];
    [self.contentView addSubview:self.imageViewBig];
    [_imageViewBig release];
    self.imageViewSmall = [[UIImageView alloc] init];
    self.imageViewSmall.layer.masksToBounds = YES;
    self.imageViewSmall.layer.cornerRadius = 25;
//    self.imageViewSmall.backgroundColor = [UIColor blueColor];
    [self.contentView addSubview:self.imageViewSmall];
    [_imageViewSmall release];
    self.labelGuanZhu = [[UILabel alloc] init];
    self.labelGuanZhu.text = @"被关注:";
    self.labelGuanZhu.font = [UIFont systemFontOfSize:14];
//    self.labelGuanZhu.backgroundColor = [UIColor lightGrayColor];
    [self.contentView addSubview:self.labelGuanZhu];
    [_labelGuanZhu release];
    self.labelGuanZhuShu = [[UILabel alloc] init];
    self.labelGuanZhuShu.font = [UIFont systemFontOfSize:13];
    self.labelGuanZhuShu.textAlignment = NSTextAlignmentLeft;
//    self.labelGuanZhuShu.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:self.labelGuanZhuShu];
    [_labelGuanZhuShu release];

}

- (void)layoutSubviews{
    [super layoutSubviews];
    self.imageViewSmall.frame = CGRectMake(20, 20, 50, 50);
    self.labelOne.frame = CGRectMake(self.imageViewSmall.frame.origin.x + 10 + self.imageViewSmall.frame.size.width, self.imageViewSmall.frame.origin.y + self.imageViewSmall.frame.size.height / 2 - 10, 135, 20);
    self.imageViewBig.frame = CGRectMake(0, self.labelOne.frame.origin.y + 30 + self.labelOne.frame.size.height, ScreenWidth, 255);
    self.labelGuanZhu.frame = CGRectMake(self.labelOne.frame.origin.x + self.labelOne.frame.size.width, self.labelOne.frame.origin.y, 50, 15);
    self.labelGuanZhuShu.frame = CGRectMake(self.labelGuanZhu.frame.origin.x + self.labelGuanZhu.frame.size.width, self.labelGuanZhu.frame.origin.y, 40, self.labelGuanZhu.frame.size.height);
}

- (void)setModelJieShouT:(FZ_RootModelR *)modelJieShouT{
    if (_modelJieShouT != modelJieShouT) {
        [_modelJieShouT release];
        _modelJieShouT = [modelJieShouT retain];
    }
    
    [self.imageViewBig sd_setImageWithURL:[NSURL URLWithString:modelJieShouT.pic] placeholderImage:WAIT_PICTURE];
    [self.imageViewSmall sd_setImageWithURL:[NSURL URLWithString:[modelJieShouT.user objectForKey:@"avatar"]] placeholderImage:WAIT_PICTURE];
    self.labelOne.text = [modelJieShouT.user objectForKey:@"name"];
    self.labelGuanZhuShu.text = [modelJieShouT.user objectForKey:@"followed_count"];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
